# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Tests for common transforms.

load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")

package(
    features = ["layering_check"],
    licenses = ["notice"],  # Apache 2.0
)

iree_lit_test_suite(
    name = "lit",
    srcs = enforce_glob(
        [
            "annotate_kernel_for_translation.mlir",
            "buffer_instructions_optimization.mlir",
            "config_direct_conv_tile_and_fuse.mlir",
            "config_igemm_tile_and_fuse.mlir",
            "config_tile_and_fuse.mlir",
            "config_tile_and_fuse_gfx950.mlir",
            "config_vector_distribute_gfx1100.mlir",
            "config_vector_distribute_gfx942.mlir",
            "config_vector_distribute_gfx950.mlir",
            "config_vector_distribute_reduction_gfx942.mlir",
            "config_vector_distribute_reduction_gfx950.mlir",
            "config_user_vector_distribute.mlir",
            "configure_buffer_instructions.mlir",
            "pipeline_direct_conv_tile_and_fuse.mlir",
            "pipeline_elementwise_f8fnuz.mlir",
            "pipeline_elementwise_f8ocp.mlir",
            "pipeline_igemm_tile_and_fuse.mlir",
            "pipeline_scaled_truncation_gfx950.mlir",
            "pipeline_tile_and_fuse.mlir",
            "pipeline_tile_and_fuse_gfx950.mlir",
            "pipeline_vector_distribute_dynamic_shapes_gfx942.mlir",
            "pipeline_vector_distribute_gfx942.mlir",
            "pipeline_vector_distribute_reduction_gfx942.mlir",
            "pipeline_vector_distribute_gfx950.mlir",
            "pipeline_vector_distribute_gfx1100.mlir",
        ],
        include = ["*.mlir"],
    ),
    cfg = "//compiler:lit.cfg.py",
    tools = [
        "//tools:iree-opt",
        "@llvm-project//llvm:FileCheck",
        "@llvm-project//llvm:not",
    ],
)
